package com.itheima.jihe;

import java.util.HashMap;

public class Test01 {
    public static void main(String[] args) {

        HashMap<String, Student> hm = new HashMap<>();

        Student student1 = new Student("01", "张三", 21, Gender.MALE);
        Student student2 = new Student("02", "李四", 19, Gender.MALE);
        Student student3 = new Student("03", "王五", 20, Gender.FEMALE);

        hm.put(student1.getNo(), student1);
        hm.put(student2.getNo(), student2);
        hm.put(student3.getNo(), student3);



       hm.forEach((k,v)->{
           if(k.equals("01")){
               System.out.print("学号：" + v.getNo());
               System.out.print("，姓名：" + v.getName());
               System.out.print("，年龄：" + v.getAge());
               System.out.println("，性别：" + v.getGender().getSex());
           }
       });

    }
}
